#!/bin/bash
BkPath=/home/back
LogFile=/home/back/back.log
DBPath=/var/log
NewFile="$BkPath"/back$(date +%Y%m%d).tar.gz
echo "---------------------------------------" >> $LogFile
echo $(date +"%y-%m-%d %H:%M:%S") >> $LogFile
echo "---------------------------------------" >> $LogFile
tar cpzvf $NewFile $DBPath >> $LogFile 2>&1
echo "the file $DBPath backup successed!" >> $LogFile 2>&1  


